package com.lihao.test;
import org.apache.thrift.TException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;



public class HelloWorldImpl implements HelloWorldService.Iface {

    Logger logger =  LoggerFactory.getLogger(HelloWorldImpl.class);
    public HelloWorldImpl() {
    }

    @Override
    public String sayHello(String username) throws TException {
        return "Hi," + username + " welcome to thrift demo world";
    }

    @Override
    public Reponse send(Request request) throws TException {
        String json = request.getParamJSON();
        String serviceName = request.getServiceName();
//        logger.info("得到的json：" + json + " ；得到的serviceName: " + serviceName);
        System.out.println("得到的json：" + json + " ；得到的serviceName: " + serviceName);

        // 构造返回信息
        Reponse response = new Reponse();
        response.setResponeCode(RESCODE._200);
        response.setResponseJSON("{\"user\":\"yinwenjie\"}");
        return response;
    }

}
